<%@ page pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/base/taglibs.jsp"%>
<html>
	<head>
		<link href="${ctx}/css/main.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="${ctx}/js/My97DatePicker/WdatePicker.js"></script>
		<script language="javascript">
			function submitAction(action){
				document.searchForm.action = action ;
				document.searchForm.submit();
			}
			
			function select(action,id){
				location.href = "${ctx}/" + action + "?id=" + id;
			}
		
			function doDelete(action,id){
				if(confirm('是否确认删除？')){
					location.href = "${ctx}/" + action + "?id=" + id ;
				}
			}
			
			function init() {
				document.getElementById("messageDateFrom").value = "";
				document.getElementById("messageDateTo").value = "";
				document.getElementById("doneTimeFrom").value = "";
				document.getElementById("doneTimeTo").value = "";
				document.getElementById("displayFlag").value = "";
			}
		</script>
	</head>
	
	<body>
		<form method="post" action="" name="searchForm">
			<table border="0" cellspacing="1" cellpadding="3" align="center" width="100%">
				<tr>
					<td width="20%" class="td2">
						是否已处理
					</td>
					<td width="30%" class="td2">
						<select name="flag" id="flag" style="width:200px">
							<c:if test="${messageBoard.flag == '1'}">
								<option value="1" selected="selected">已处理</option>
								<option value="0">未处理</option>
							</c:if>
							<c:if test="${messageBoard.flag != '1'}">
								<option value="1" >已处理</option>
								<option value="0" selected="selected">未处理</option>
							</c:if>
						</select>
					</td>
					<td width="20%" class="td2">
						是否显示
					</td>
					<td width="30%" class="td2">
						<select name="displayFlag" id="displayFlag" style="width:200px">
							<option value=""></option>
							<c:if test="${messageBoard.displayFlag == '1'}">
								<option value="1" selected="selected">显示</option>
								<option value="0">不显示</option>
							</c:if>
							<c:if test="${messageBoard.displayFlag == '0'}">
								<option value="1" >显示</option>
								<option value="0" selected="selected">不显示</option>
							</c:if>
							<c:if test="${empty messageBoard.displayFlag}">
								<option value="1" >显示</option>
								<option value="0" >不显示</option>
							</c:if>
						</select>
					</td>
				</tr>
				<tr>
					<td width="20%" class="td2">
						留言时间（起）
					</td>
					<td width="30%" class="td2">
						<input size="28" readonly="readonly" id="messageDateFrom" type="text" name="messageDateFrom" value="${messageBoard.messageDateFrom}"/>
						<img onclick="WdatePicker({el:'messageDateFrom'})" src="${ctx}/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
					<td width="20%" class="td2">
						留言时间（止）
					</td>
					<td width="30%" class="td2">
						<input size="28" readonly="readonly" id="messageDateTo" type="text" name="messageDateTo" value="${messageBoard.messageDateTo}"/>
						<img onclick="WdatePicker({el:'messageDateTo'})" src="${ctx}/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
				</tr>
				<tr>
					<td width="20%" class="td2">
						处理时间（起）
					</td>
					<td width="30%" class="td2">
						<input size="28" readonly="readonly" id="doneTimeFrom" type="text" name="doneTimeFrom" value="${messageBoard.doneTimeFrom}"/>
						<img onclick="WdatePicker({el:'doneTimeFrom'})" src="${ctx}/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
					<td width="20%" class="td2">
						处理时间（止）
					</td>
					<td width="30%" class="td2">
						<input size="28" readonly="readonly" id="doneTimeTo" type="text" name="doneTimeTo" value="${messageBoard.doneTimeTo}"/>
						<img onclick="WdatePicker({el:'doneTimeTo'})" src="${ctx}/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
				</tr>
				<tr>
					<td class="td11" align="left" colspan="4">
						<input type="button" name="search" value="查询" onClick="submitAction('messageBoardSearch.ac')">
						&nbsp;&nbsp;<input type="button" name="reset" value="重置" onClick="init()">
					</td>
				</tr>
			</table>
			<BR>
			<table border="0" cellspacing="1" cellpadding="3" align="center" width="100%">
				<tr>
					<td width="10%" class="td1" align="center">
						动作
					</td>
					<td width="10%" class="td1" align="center">
						留言日期
					</td>
					<td width="10%" class="td1" align="center">
						留言人
					</td>
					<td width="20%" class="td1" align="center">
						留言商品名称
					</td>
					<td width="10%" class="td1" align="center">
						是否已处理
					</td>
					<td width="10%" class="td1" align="center">
						处理时间
					</td>
					<td width="10%" class="td1" align="center">
						处理人
					</td>
					<td width="10%" class="td1" align="center">
						是否显示
					</td>
					<td width="10%" class="td1" align="center">
						删除
					</td>
				</tr>
				<c:forEach var="messageBoard" items="${messageBoardList}">
					<tr>
						<td class="td2" align="center">
							<a href="javascript:select('selectMessageBoard.ac','${messageBoard.id}');">选择</a>
						</td>
						<td class="td2" align="center">
							${messageBoard.messageDate}
						</td>
						<td class="td2" >
							${messageBoard.creator}
						</td>
						<td class="td2">
							${messageBoard.prodName}
						</td>
						<td class="td2" align="center">
							${messageBoard.flag}
						</td>
						<td class="td2" align="center">
							${messageBoard.doneTime}
						</td>
						<td class="td2">
							${messageBoard.modifier}
						</td>
						<td class="td2" align="center">
							${messageBoard.displayFlag}
						</td>
						<td class="td2" align="center">
							<img src="${ctx}/images/delete0.png" onclick="javascript:doDelete('deleteMessageBoard.ac','${messageBoard.id}');">
						</td>
					</tr>
				</c:forEach>
			</table>
		</form>
	</body>
</html>